package io02;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo {
    public static void main(String[] args) throws IOException {
        //最常用的写入字符串的方式:
        //底层连接了BufferedWriter，连接了OutputStreamWriter，连接了FileOutputStream
        PrintWriter pw = new PrintWriter("pw.txt");
        pw.println();
        pw.println();
        System.out.println("写出完毕");
        pw.close();


/*        FileOutputStream fos = new FileOutputStream("pw.txt");//文件流(低级流)
        OutputStreamWriter osw = new OutputStreamWriter(fos,StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);//缓冲字符流(高级流)
        bw.write("");
        bw.write("");
        System.out.println("写出完毕");
        bw.close();*/

    }
}
